package com.tzb.order.controller;


import com.tzb.order.entity.Product;
import com.tzb.order.feign.IProductFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private IProductFeignClient productFeignClient;

    @GetMapping("/buy/{id}")
    public Product findById(@PathVariable Long id) {
        Product product = null;
        product = productFeignClient.findById(id);
        return product;
    }

    @GetMapping("/{id}")
    public String findOrderById(@PathVariable Long id){
        return "调用订单系统查询订单";
    }

}
